<template>
  <div>
    <div>
      账号：
      <input type="text" v-model="userForm.user" />
    </div>
    <div>
      密码：
      <input type="text" v-model="userForm.pass" />
    </div>
    <div>
      <button @click="doLogin">进入系统</button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userForm: {
        user: '',
        pass: ''
      }
    }
  },
  methods: {
    doLogin() {
      window.localStorage.setItem('user', this.userForm.user)
      // 路由跳转
      this.$router.replace('/news/100')
    }
  }
}
</script>

<style lang="scss" scoped></style>
